# -*- coding: utf-8 -*-
"""
Created on Wed Jun  1 05:55:23 2022

@author: zhao
"""

from scipy.special import iv #导入虚宗量 Bessel函数 Modified Bessel function of the first kind of real order.
import numpy as np
import matplotlib.pyplot as plt
import scienceplots
x=np.linspace(0.,5,100)
plt.style.use('science') # 这个需要单独安装
plt.figure(1,dpi=300)  
for n in (0,1.0,2,3):
    plt.plot(x, iv(n,x),linewidth = '0.7',label=r'$\nu $='+str("{:.2f}".format(n))) 

plt.plot(x,np.zeros(100),linewidth = '0.1',color='black') 
plt.title('Imaginary Bessel function')
plt.xlabel(r'$x$')
plt.ylabel(r'$I_{\nu} (x)$')
plt.ylim(-1,5)
#plt.legend(loc='upper right')
plt.legend()
name='imaginary-Bessel.png'

plt.savefig(name,dpi=300)
plt.show() 